﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        private string lang ="en";

        public Form1()
        {
            InitializeComponent();
         
        }
        private void ChangeLanguage(string lang) //method
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }
        private void btnOpenNewForm_Click(object sender, EventArgs e)
        {
            Form2 form2 = new Form2();
            form2.Show();
            form2.Icon = IDE_week2_Forms_project.Properties.Resources.ICON2;
        }

        private void CallClasOne(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }

        private void ChangeIconForm1(object sender, EventArgs e)
        {
            Icon = IDE_week2_Forms_project.Properties.Resources.ICON1;

        }

        private void ResetIcon(object sender, EventArgs e)
        {
            Icon = null;
        }

        private void btnChangeLanguage_Click(object sender, EventArgs e)
        {
      
            if (lang == "en")
            {
                ChangeLanguage ("nl");
                lang = "nl";
            }
            else
            {
                lang = "en";
                ChangeLanguage("en");
     
           }
         
        }


        }
 
       
        }
